import { _decorator, Component, Node, Label, AudioSource } from 'cc';
const { ccclass, property } = _decorator;


@ccclass('Mute')
export class Mute extends Component {
    @property(Label)
    audioLabel:Label=null;
    audioMute()
    {
        this.node.active=!this.node.active;
        this.node.active?(this.audioLabel.string='静音',this.node.getChildByName('bgm').getComponent(AudioSource).play()):this.audioLabel.string='开声';
    }
}

